package com.ggs.starbug.rmi.client;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.Remote;
import java.rmi.RemoteException;

/**
 * @Author lianghaohui
 * @Date 2021/12/13 11:45
 * @Description
 */
public class RMIClient {

    public static void main(String[] args) throws MalformedURLException, NotBoundException, RemoteException {
        com.ggs.starbug.rmi.server.User answer;
        String userId = "010001";
        com.ggs.starbug.rmi.server.UserService access = (com.ggs.starbug.rmi.server.UserService) Naming.lookup("rmi://localhost:19000/user");
        answer = access.findUser(userId);
        System.out.println(answer);
    }

}
